package com.zj.mapping;

import com.zj.utils.Configuration;

import java.util.List;

public class MappedStatement {
    private String resource;
    private Configuration configuration;
    private String id;
    private SqlSource sqlSource;
    private StatementType statementType;
    private SqlCommandType sqlCommandType;
    private Class resultType;

public MappedStatement(String id,SqlCommandType type,SqlSource sqlSource,Class resultType,Configuration cfg,String resource){
    this.id=id;
    this.sqlCommandType=type;
    this.sqlSource=sqlSource;
    this.configuration=cfg;
    this.resource=resource;
    this.statementType=StatementType.PREPARED;
    this.resultType=resultType;
}

    public StatementType getStatementType() {
        return statementType;
    }

    public String getResource() {
        return resource;
    }

    public void setResource(String resource) {
        this.resource = resource;
    }

    public Configuration getConfiguration() {
        return configuration;
    }

    public void setConfiguration(Configuration configuration) {
        this.configuration = configuration;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public SqlSource getSqlSource() {
        return sqlSource;
    }

    public void setSqlSource(SqlSource sqlSource) {
        this.sqlSource = sqlSource;
    }

    public SqlCommandType getSqlCommandType() {
        return sqlCommandType;
    }

    public void setSqlCommandType(SqlCommandType sqlCommandType) {
        this.sqlCommandType = sqlCommandType;
    }

    public BoundSql getBoundSql(Object parameterObject){
        BoundSql boundSql = sqlSource.getBoundSql(parameterObject);
        return boundSql;
    }

    public Class getResultType() {
        return resultType;
    }

    public void setResultType(Class resultType) {
        this.resultType = resultType;
    }
}
